-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain how to work with subtree #70654
Conversation
Waiting with the review and r+ until the conversation re. "should we do this" that you're having with @eddyb has resolved itself. =P Others should feel free to propose text tweaks though. :) |
see #70655 for a live example of making clippy a subtree |
A question that I didn't see answered: Who is expected to do the "git subtree push/pull"? Are we saying that this is the job of the (e.g.) clippy team, and they're going to do it on some kind of regular schedule? |
I am confused, did we change the approach or did we just use the wrong term so far? EDIT: there are just too many discussion going on too fast in concurrent threads right now. Looks like we indeed changed approaches but that was mentioned in one of the 3 other threads, not here, or so.^^ |
CONTRIBUTING.md
Outdated
You always need to specify the `-P` prefix to the subtree directory and the corresponding remote | ||
repository. If you specify the wrong directory or repository | ||
you'll get very fun merges that try to push the wrong directory to the wrong remote repository. | ||
Luckily you can just abort this without any consequences and try again. It is usually fairly obvious |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you abort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When pulling, git merge --abort
I'd guess? We should test it.
Pushing should always succeed, but if you try to open PR from a malformed branch, it will just look very strange and be unmergeable.
Presumably you can redo it with the right directory specified and the PR will become correct (idk if it overwrites an existing branch though, or maybe it has a -f
/--force
flag like git push
does?).
Reassigning to someone more git-savvy than me. :) |
One final note: I think that this should also go into the rustc-dev-guide. I think it's fine to just land a chapter there that points to CONTRIBUTING.md as the canonical documentation point, though. |
modified to move the files from the specified directory to the tool repo root. | ||
|
||
Make sure to not pick the `master` branch on the tool repo, so you can open a normal PR to the tool | ||
to merge that subrepo push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that the important thing is to not have git@github.com:rust-lang/rust-clippy.git
as the repository URL, i.e., you should never be pushing into branches there. But which branch you choose in your fork is largely irrelevant (you can push to master if you like).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have my own fork of clippy and miri, should I have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to keep personal feature branches out of the main repo. Not a strong opinion though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oli-obk Not to mention that you can only do this because of your powers on those repos, most contributors have to use a fork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO for repos with many contributors the amount of feature branches in the main repo should be kept as low as possible. Clippy has even an issue, where a contributor complained about the amount of feature branches: rust-lang/rust-clippy#4745
you'll get very fun merges that try to push the wrong directory to the wrong remote repository. | ||
Luckily you can just abort this without any consequences by throwing away either the pulled commits | ||
in rustc or the pushed branch on the remote and try again. It is usually fairly obvious | ||
that this is happening because you suddenly get thousands of commits that want to be synchronized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct that subtrees mean that we should no longer need to give particular priority to syncs from clippy upstream? i.e. they're "just normal PRs"? (They would essentially be no different to other PRs being made to that code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priority meaning @bors p=1
? That definitely should end with the gating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jup, all the "time critical" stuff happens on the tool's repo side and not when syncing into rustc. Unless there are bug fixes, but our policy for tool bugfixes and rustc bugfixes willl not have to differ.
I want us to also answer these questions before we proceed here:
|
I think most new lints and features should still be implemented in the Clippy repository. If there was a new lint implemented in the rust repository, and this lint would fail the stricter CI of the Clippy repo, this lint would have to be re-reviewed and maybe modified during a sync. Also the separation would be clearer: rustups in rust-lang/rust, everything else in the Clippy repo.
Enforcing |
Tidy mostly only enforces rustfmt; we do currently pin to a specific nightly which might not be optimal for clippy -- but I think rustfmt at least claims stability (even if that sometimes doesn't hold up in practice, I think). I suspect we'd for now hold off on enforcing rustfmt for the clippy repository (we can land that at a future date), just to avoid bundling too much into the initial rollout. But I suspect we'd fairly quickly want to start doing so, especially as it sounds like at least in the clippy case that should be fairly easy. |
We're currently looking to enhance our dev tooling to behave more like |
From a Miri perspective, I very much like this approach. |
I agree with @Mark-Simulacrum's suggestions, although the "tidy" thing is definitely a drag. |
I would also echo @nikomatsakis' in saying that I would like to see a link in the rustc-dev-guide pointing at these docs, but that can happen once we land this PR, of course. Okay, I think we have all of our checkboxes checked here. @oli-obk -- do you know of anything outstanding? If not, let's kick off FCP on the tracking issue (rust-lang/compiler-team#266). |
Per rust-lang/compiler-team#266 (comment), @bors r+ rollup Once this lands I can take a look at the actual submodule to subtree PR. |
📌 Commit 7928c45 has been approved by |
Rollup of 4 pull requests Successful merges: - rust-lang#70654 (Explain how to work with subtree) - rust-lang#71092 (Remove some usage of `DUMMY_HIR_ID`) - rust-lang#71103 (Add test case for type aliasing `impl Sized`) - rust-lang#71109 (allow const generics in const fn) Failed merges: r? @ghost
…acrum Make clippy a git subtree instead of a git submodule r? @eddyb cc rust-lang#70651 documentation at rust-lang#70654
``` | ||
git subtree push -P src/tools/clippy git@github.com:your-github-name/rust-clippy sync-from-rust | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not working at all on my machine:
git subtree push -P src/tools/clippy git@github.com:matthiaskrgr/rust-clippy2 sync-from-rust
git push using: git@github.com:matthiaskrgr/rust-clippy2 sync-from-rust
/usr/lib/git-core/git-subtree: line 757: 171266 Done eval "$grl"
171267 Segmentation fault (core dumped) | while read rev parents; do
process_split_commit "$rev" "$parents" 0;
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O_o can you run a top
in parallel and have a look at your memory consumption?
cc #70651
r? @Centril @RalfJung
This PR just contains the usage documentation, we'll do actual moves in later PRs